package com.gen.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gen.dao.IStudentDao;
import com.gen.entity.Student;
@Service
public class StudentServiceImpl implements IStudentService{
	@Autowired
	private IStudentDao studentDao;
	
	public IStudentDao getStudentDao() {
		return studentDao;
	}

	public void setStudentDao(IStudentDao studentDao) {
		this.studentDao = studentDao;
	}

	@Override
	public int add(Student student) {
		return studentDao.add(student);
	}

	@Override
	public int delete(Integer id) {
		return studentDao.delete(id);
	}

	@Override
	public int update(Student student) {
		return studentDao.update(student);
	}

	@Override
	public Student selectOne(Integer id) {
		return studentDao.selectOne(id);
	}

	@Override
	public List<Student> selectAll() {
		return studentDao.selectAll();
	}

	@Override
	public void testTransaction() {
		delete(4);
		Integer.parseInt("a");
		delete(3);		
	}

	@Override
	public List<Student> selectByParam(Student student) {
		return studentDao.selectByParam(student);
	}

}
